<html>
<head><meta charset="utf-8"><title>Process for moving lints from Clippy to Rustc · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html">Process for moving lints from Clippy to Rustc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214891680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214891680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214891680">(Oct 28 2020 at 20:13)</a>:</h4>
<p>Related to the "Down On Lints" discussion: What's the process for getting lints that are unambiguous correctness problems into rustc from clippy?</p>
<p>For example, I recently beefed up <a href="https://rust-lang.github.io/rust-clippy/master/index.html#invalid_atomic_ordering">https://rust-lang.github.io/rust-clippy/master/index.html#invalid_atomic_ordering</a> and think that it makes more sense in rustc than in clippy</p>



<a name="214891748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214891748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214891748">(Oct 28 2020 at 20:13)</a>:</h4>
<p><span class="user-mention" data-user-id="209168">@Thom Chiovoloni</span> you make an MCP on <a href="https://github.com/rust-lang/compiler-team/issues/">https://github.com/rust-lang/compiler-team/issues/</a>, which 99% of the time is accepted without comment, then make a PR uplifting the lint</p>



<a name="214891804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214891804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214891804">(Oct 28 2020 at 20:14)</a>:</h4>
<p>example PR: <a href="https://github.com/rust-lang/rust/pull/75671">https://github.com/rust-lang/rust/pull/75671</a></p>



<a name="214891826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214891826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214891826">(Oct 28 2020 at 20:14)</a>:</h4>
<p>hmmm, okay, noted. Maybe I'll try next week or so</p>



<a name="214893681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214893681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214893681">(Oct 28 2020 at 20:31)</a>:</h4>
<p>luv 2 start discussions :^)</p>



<a name="214902668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214902668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214902668">(Oct 28 2020 at 21:56)</a>:</h4>
<p><span class="user-mention" data-user-id="209168">@Thom Chiovoloni</span> My recollection of the last conversation about lint uplift was that lang didn't want to decide it all in one huge RFC for everything (because that mixed too many conversations to make progress) but that individual lints getting added was great because usually people pick ones where everyone just sortof goes "yeah, sounds good".  (One day we'll get far enough along that we start seeing sketchier ones, and guidance might change, but I don't think we're there yet.)</p>



<a name="214902835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214902835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214902835">(Oct 28 2020 at 21:58)</a>:</h4>
<p>That said, personally I'd like to see more progress be made on more-generic lints so that they can be put as attributes in the library instead of needing a new lint every time.  Like imagine <code>#[always_panics_when(step == 0)]</code> on <code>Iterator::step_by</code> instead of that needing to be its own special lint.  (Plenty of design questions and bikeshedding to resolve, so maybe not explicitly that, but that's the idea.  I could also imagine something that expands to that plus an <code>assert!</code> in the body to reduce duplication, kinda like the discussion in <a href="https://internals.rust-lang.org/t/idea-make-assert-a-keyword-rejected/13066/8?u=scottmcm">https://internals.rust-lang.org/t/idea-make-assert-a-keyword-rejected/13066/8?u=scottmcm</a>, for example.)</p>



<a name="214903912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214903912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214903912">(Oct 28 2020 at 22:10)</a>:</h4>
<p>I think that makes sense but probably not for the atomics, which for some of them gets rather complex (e.g. the requirement for the success/fail args in compare_exchange</p>



<a name="214905857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214905857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214905857">(Oct 28 2020 at 22:32)</a>:</h4>
<p>Yeah, for cmpxcg I agree.  I was just looking at the first example in the clippy for for it, and <code>load</code> just has "Panics if <code>order</code> is [<code>Release</code>] or [<code>AcqRel</code>]." in its doccomment, which would translate quite well.  (Could even generate the doc comment section in a proc macro :P)</p>



<a name="214909961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214909961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214909961">(Oct 28 2020 at 23:24)</a>:</h4>
<p>Yeah, and in general that kind of thing being easy could ease the number of wrapper types APIs need to have. I think my main hesitation is honestly having it expand to the assert, since there are a lot of ways you might want to write that with different tradeoffs for error messages, and it could force additional checking where you dont want it.</p>



<a name="214909969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214909969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214909969">(Oct 28 2020 at 23:24)</a>:</h4>
<p>that said we're getting off topic.</p>



<a name="214920355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Process%20for%20moving%20lints%20from%20Clippy%20to%20Rustc/near/214920355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Process.20for.20moving.20lints.20from.20Clippy.20to.20Rustc.html#214920355">(Oct 29 2020 at 02:35)</a>:</h4>
<p>(Agreed, I'd definitely start with just the lint version, and the expansion to a version that adds the <code>assert!</code> or the doc comment or whatever can happen later.)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>